<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>2-26局部注册组件</title>
</head>
<body>
<div id="app">
  <my-component></my-component>
</div>
</body>
<script src="js/vue.js"></script>
<script>
  var temp={
    data(){
      return {
        count: 0
      }
    },
    template: '<button @click=\'count++\'>被点击了{{count}}次</button>'
  }
  new Vue({
    el:"#app",
    components:{
      myComponent:temp
    }
  })
</script>
</html>